Skip to content

Cleanup logging#802

Merged
Charles-Gagnon merged 3 commits intomainfrom
chgagnon/cleanupLogging
Apr 14, 2023
Merged

Cleanup logging#802
Charles-Gagnon merged 3 commits intomainfrom
chgagnon/cleanupLogging

Conversation

@Charles-Gagnon
Copy link
Contributor

@Charles-Gagnon Charles-Gagnon commented Apr 13, 2023

Part 1 - will port over to trigger branch and cleanup the rest there after this gets in.

Greatly cleaning up the debug logging we do to avoid spamming the logs with too much verbose logging. In general the idea now is to only do debug logging for one-time or occasional events (such as startup configuration). For everything else we should rely on errors being captured and logged

  1. Removed all of the BEGIN/END logs. Those have never really been anything we've used so just straight up removing them and relying on the queries failing due to timeout or other if there's any issues
  2. Added SqlCommand.Execute... extension method to log error if a call fails so we can output the query text that caused the error which could still be very valuable to see (we've already had a couple instances of unexpected syntax causing query failures)
  3. Removed the ThreadId helper functions, that was primarily added to help keep track of all the BEGIN/END calls (especially for trigger) and so with the removal of those they aren't really necessary anymore

Sample log output when an error occurs:

image

@Charles-Gagnon Charles-Gagnon merged commit 705a1ef into main Apr 14, 2023
@Charles-Gagnon Charles-Gagnon deleted the chgagnon/cleanupLogging branch April 14, 2023 18:56
PBBlox pushed a commit to PBBlox/azure-functions-sql-extension that referenced this pull request Apr 6, 2025
* Cleanup logging

* One more

* Fix compile
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants